#pragma once
#include "CDependencyObject.h"


class CFrameworkElement;
class CVisualState;
class CVisualStateGroup;
class CVisualTransition;
class CTimeline;
class CStoryboard;
class CControl;

class CVisualStateManager :
	public CDependencyObject
{

private: 
	CVisualStateManager(CCoreServices * pCore);
	static HRESULT GetTransition(CFrameworkElement * pControl, CVisualStateGroup * pVisualStateGroup, CVisualState * pFrom, CVisualState * pTo, CVisualTransition * * ppVisualTransition);
	static HRESULT GenerateDynamicTransitionAnimations(CFrameworkElement * pControl, CVisualTransition * pTransition, CVisualStateGroup * pGroup, CVisualState * pNewState, CStoryboard * * ppStoryboard);
	static HRESULT GenerateFromAnimation(CFrameworkElement * pRoot, CTimeline * pTimeline, CTimeline * * ppFromAnimation);
	static HRESULT GenerateToAnimation(CFrameworkElement * pRoot, CTimeline * pTimeline, CTimeline * * ppToAnimation);
	static HRESULT SetTargetValues(CFrameworkElement * pRoot, CTimeline * pSrc, CTimeline * pDst);
	static HRESULT SetEasingFunction(CTimeline * pTimeline, CDependencyObject * pEasingFunction);
public: 
	static HRESULT Create(CDependencyObject * * ppObject, CREATEPARAMETERS * pCreate);
	virtual XUINT32 GetTypeIndex() const;
	static HRESULT GoToState(struct Xcp_IDependencyObject * pObject, const XUINT16 * pStateName, XBOOL UseTransitions);
	static HRESULT GoToStateInternal(CControl * pControl, CFrameworkElement * pImplControl, CVisualStateGroup * pGroup, CVisualState * pNewState, XBOOL UseTransitions);
};